# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-mime-tools
_realname=MIME-tools
pkgver=5.509
pkgrel=2
pkgdesc="Perl modules for parsing (and creating!) MIME entities"
url="http://search.cpan.org/~doneill/MIME-tools-$pkgver/"
arch="noarch"
license="PerlArtistic GPL"
depends="perl perl-io-stringy perl-mailtools perl-convert-binhex"
makedepends="perl-dev"
checkdepends="perl-test-deep perl-test-pod"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/D/DS/DSKOLL/$_realname-$pkgver.tar.gz"
builddir="$srcdir/$_realname-$pkgver"

prepare() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1
}

build() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	cd "$builddir"
	make test
}

sha512sums="0407b09916144eafbee0c75758306e0f44c27db0e8aabf033267f9903f676f0415de99927dcfdb69f9e9d4123d63c280f526dff92e0d97744761c888df90667a  MIME-tools-5.509.tar.gz"
